﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SWENAssignment.ThinHui
{
    public partial class retrieveStaffProfile1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //lblStaffID.Text = (string)Session["staffId"];
            //if (!Page.IsPostBack)
            //{
            //    staffDetails s = DBmanager.getByStaffId(lblStaffID.Text);
            //    lblStaffID.Text = s.StaffId;
            //    lblLastName.Text = s.lastName;
            //    lblFirstName.Text = s.firstName;
            //    lblNRIC.Text = s.nric;
            //    lblDOB.Text = Convert.ToString(s.dob);
            //    lblContactNo.Text = Convert.ToString(s.ContactNumber);
            //    lblAddress.Text = s.address;
            //    lblEmail.Text = s.email;
            //    lblGender.Text = s.gender;
            //    lblBankAccType.Text = s.bankAccType;
            //    lblBankAccNo.Text = s.bankAccNumber;
            //    lblDutyType.Text = s.dutyType;
            //}
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string staffId = tbxSearchStaffId.Text;
            if (DBmanager.CheckStaffExistbyStffId(staffId) == 1)
            {
                Session["staffId"] = tbxSearchStaffId.Text;
                Server.Transfer("searchStaffProfileSuccessfully.aspx");
            }
            else
            {
                lblStatus.Text = "Cannot Find the StaffId !";
            }
        }
    }
}